using System.Collections;
using UnityEngine;

public class RackBallCollision : MonoBehaviour
{
	public void OnCollisionEnter(Collision collision)
	{
		if (collision.transform.name.Contains("Destination") || collision.transform.CompareTag("Ball"))
		{
			StartCoroutine(CollisionEnter());
		}
	}

	private IEnumerator CollisionEnter()
	{
		yield return new WaitForFixedUpdate();
		GetComponent<Rigidbody>().velocity = Vector3.zero;
		GetComponent<Rigidbody>().angularVelocity = Vector3.zero;
	}
}
